import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class Main extends JFrame
{
	JMenu infoMenu, reportMenu, billMenu, serviceMenu;
	JMenuItem checkAvailRooms, assignRoomToCustomer, releaseRoom;
	JMenuItem reportOccByRoomType, reportOccByDateRange, reportOccByHotel, reportOccupants, reportPercentRoomsOccupied, reportStaffByRole, reportCustomerByStaff;
	JMenuItem generateBill, generateItemizedBill;
	JMenuItem insertService;
 
	JMenuBar menuBar;
	JDesktopPane desktop;
	public Main(String title)
	{
		this.setTitle(title);
		this.setLayout(new BorderLayout());
		this.setSize(800, 600);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		this.setUpGui();
		this.setVisible(true);
	}
	void setUpGui()
	{
		desktop = new JDesktopPane();
		menuBar = new JMenuBar();
		setJMenuBar(menuBar);

		String title = "Add new customer";
		JInternalFrame iframe = createInternalFrame(title);

		infoMenu = new JMenu("Information Processing");
		checkAvailRooms = new JMenuItem("Check Available Rooms");
//		checkAvailRooms.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_C, ActionEvent.ALT_MASK));
		assignRoomToCustomer = new JMenuItem("Assign Room to Customer");
//		assignRoomToCustomer.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, ActionEvent.ALT_MASK));
		releaseRoom = new JMenuItem("Release Room");
//		releaseRoom.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_R, ActionEvent.ALT_MASK));
		infoMenu.add(checkAvailRooms);
		infoMenu.add(assignRoomToCustomer);
		infoMenu.add(releaseRoom);
	
		reportMenu = new JMenu("Report Generation");
		reportOccByRoomType = new JMenuItem("Report Occupancy By Room Type");
		reportOccByDateRange = new JMenuItem("Report Occupancy By Date Range");
		reportOccByHotel = new JMenuItem("Report Occupancy By Hotel");
		reportOccupants = new JMenuItem("Report Occupants");
		reportPercentRoomsOccupied = new JMenuItem("Report Percent Rooms Occupied");
		reportStaffByRole = new JMenuItem("Report Staff By Role");
		reportCustomerByStaff = new JMenuItem("Report Customer By Staff");	
		reportMenu.add(reportOccByRoomType);
		reportMenu.add(reportOccByDateRange);
		reportMenu.add(reportOccByHotel);
		reportMenu.add(reportOccupants);
		reportMenu.add(reportPercentRoomsOccupied);
		reportMenu.add(reportStaffByRole);
		reportMenu.add(reportCustomerByStaff);


		billMenu = new JMenu("Bill Maintenance");
		generateBill = new JMenuItem("Generate Bill");
		generateItemizedBill = new JMenuItem("Generate Itemized Bill");
		billMenu.add(generateBill);
		billMenu.add(generateItemizedBill);	

		serviceMenu = new JMenu("Service Maintenance");
		insertService = new JMenuItem("Insert service");
		serviceMenu.add(insertService);

		infoMenu.setMnemonic('I');
		reportMenu.setMnemonic('R');
		billMenu.setMnemonic('B');
		serviceMenu.setMnemonic('S');

		menuBar.add(infoMenu);
		menuBar.add(reportMenu);
		menuBar.add(billMenu);
		menuBar.add(serviceMenu);

		desktop.add(iframe);
		this.add(desktop, BorderLayout.CENTER);
	}
	public JInternalFrame createInternalFrame(String title)
	{	
		boolean resizable = true;
		boolean closeable = true;
		boolean maximizable  = true;
		boolean iconifiable = true;
		JInternalFrame iframe = new JInternalFrame(title, resizable, closeable, maximizable, iconifiable);

		iframe.setResizable(true);
		iframe.setSize(200, 200);
		iframe.setVisible(true);
		return iframe;
	}
	public static void main(String[] args)
	{
		Main main = new Main("WolfVillas Hotel Management System");
	}
}
